package com.company.aop;

import com.company.Dog;
import com.company.MyMethodInterceptor;
import net.sf.cglib.proxy.Enhancer;

public class CglibProxy {

    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Dog.class);
        enhancer.setCallback(new MyMethodInterceptor());
        Dog o = (Dog) enhancer.create();
        o.eat();

    }


}
